//: Playground - noun: a place where people can play

import UIKit

let urlString = "www.baidu.com"

// 1.普通写法
let url0 : NSURL? = NSURL(string: urlString)

if url0 != nil {
    _ = NSURLRequest(url:url0! as URL)
}

// 可选绑定
if let tempURL = url0 {
    _ = NSURLRequest(url: tempURL as URL)

}

// 可选绑定的简介写法
if let tempURL = NSURL(string: urlString){
    _ = NSURLRequest(url: tempURL as URL)
    
}
